package com.zhu.transaction.service;

import com.zhu.transaction.pojo.Order;
import com.zhu.transaction.pojo.OrderItem;
import com.zhu.transaction.pojo.state.AliPayState;
import com.zhu.transaction.pojo.state.BackState;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zhu
 * @since 2021-01-07
 */
public interface OrderService {

    //添加一条订单
    BackState addOneOrder(Order order);

    //获取订单列表
    List<OrderItem> getOrderList(String userId, boolean isPurchase);

    //获取所有订单
    List<OrderItem> getAllOrderList();

    //根据订单号获取订单列表
    List<Order> getOrderListByOrderId(String orderId);

    //删除订单
    BackState deleteOrder(String orderId);

    //更新订单
    BackState updateOrderState(String orderId, Integer paymentState, Integer transactionState);

    //连接微信支付接口
    Map createNative(String orderNo);

    //查询微信支付状态
    Map<String, String> queryPayStatus(String orderNo);

    //连接支付宝支付接口
    String createPayForm(String orderId, String totalPrice) throws IOException;

    //查询支付宝支付状态
    Boolean aliPayReturnNotice(AliPayState aliPayState);

    //更新支付接口
    BackState updatePayStatus(Order order);

}
